﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Lib
{
    class Board : IBoard
    {
        int height, width;
        ICell[,] celdas;
        public Board(int height, int width)
        {
            this.height = height;
            this.width = width;
            this.celdas = new ICell[width, height];
            for (int i = 0; i < width; i++)
            {
                for (int j = 0; j < height; j++)
                {
                    if (((i + j) % 2 )== 0)
                    {
                        this.celdas[i, j] = new Celda(new Color(250, 191, 143));
                    }
                    else
                    {
                        this.celdas[i, j] = new Celda(new Color(253, 233, 217));
                    }
                }
            }
        }
        public ICell GetCell(int x, int y)
        {
            return celdas[x,y];
        }
        public void SetCell(int x, int y, ICell cell)
        {
            this.celdas[x, y] = cell;
        }
        public int Width
        {
            get { return this.width; }
        }

        public int Height
        {
            get { return this.height; }
        }
        
    }
}
